﻿using Audio;
using System.Collections;
using UnityEngine;

namespace UI.ExamplePanel
{
    public class GameSeniorPanel : BasePanel<GameSeniorPanel>
    {

        private void Start()
        {
            AudioManager.Instance.PauseBGM();
            StartCoroutine(ShowDialog());
        }

        public override void Init()
        {
            base.Init();
        }

        public override void OnPressedEsc()
        {
            Debug.Log("确认要退出游戏吗?");
        }

        public IEnumerator ShowDialog()
        {
            yield return new WaitForSeconds(1f);
            DialogManager.Instance.StartDialogueForCharacter("预制公司", 0, transform, true);
            while (!DialogManager.Instance.isDialogEnd)
            {
                yield return null;
            }

            //GameManager.Instance.DoTransition(this.transform, "一段时间后......客人到来，这次的客人似乎有一些不一样呢......", GamePanel.Instance.ShowMe, 3f);
            BlackPanel.Instance.ShowMe();
            BlackPanel.Instance.ToNextPanel<GamePanel>();
            yield break;
        }
    }
}

